package com.gwt.tirso.gymkhana.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class ContestStep5 implements EntryPoint {
	
	private Label endLb = new Label("¡Enhorabuena!¡Has terminado la partida!");
	private Button finalizeBt = new Button("Finalizar");
	private VerticalPanel mainPanel = new VerticalPanel();

	@Override
	public void onModuleLoad() {
		
		loadContestStep5();

	}

	private void loadContestStep5() {
mainPanel.add(endLb);
		
		finalizeBt.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				GymkhanaWeb gw = new GymkhanaWeb();
				gw.onModuleLoad();
				RootPanel.get("contest").remove(mainPanel);
				
			}
		});
		mainPanel.add(finalizeBt);
		
		mainPanel.addStyleName("contestNext");
		RootPanel.get("contest").add(mainPanel);
		
	}

}
